import request from '@/config/axios'

/** 租户请求日志信息 */
export interface TenantRequestLog {
          id: number; // ID
          rechargeTenantId: number; // 租户ID
          url: string; // 请求URL
          params: string; // 请求参数
          respons: string; // 请求返回
          requestType: string; // 请求类型
          unitPrice?: number; // 单价(元)
          afterBalance?: number; // 请求后的余额(元)
  }

// 租户请求日志 API
export const TenantRequestLogApi = {
  // 查询租户请求日志分页
  getTenantRequestLogPage: async (params: any) => {
    return await request.get({ url: `/vos/tenant-request-log/page`, params })
  },

  // 查询租户请求日志详情
  getTenantRequestLog: async (id: number) => {
    return await request.get({ url: `/vos/tenant-request-log/get?id=` + id })
  },

  // 新增租户请求日志
  createTenantRequestLog: async (data: TenantRequestLog) => {
    return await request.post({ url: `/vos/tenant-request-log/create`, data })
  },

  // 修改租户请求日志
  updateTenantRequestLog: async (data: TenantRequestLog) => {
    return await request.put({ url: `/vos/tenant-request-log/update`, data })
  },

  // 删除租户请求日志
  deleteTenantRequestLog: async (id: number) => {
    return await request.delete({ url: `/vos/tenant-request-log/delete?id=` + id })
  },

  /** 批量删除租户请求日志 */
  deleteTenantRequestLogList: async (ids: number[]) => {
    return await request.delete({ url: `/vos/tenant-request-log/delete-list?ids=${ids.join(',')}` })
  },

  // 导出租户请求日志 Excel
  exportTenantRequestLog: async (params) => {
    return await request.download({ url: `/vos/tenant-request-log/export-excel`, params })
  },
}
